import { createRouter, createWebHashHistory, RouteRecordRaw, createWebHistory  } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home/index.vue')
  },
  {
    path: '/product',
    name: 'product',
    component: () => import('@/views/product/index.vue')
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('@/views/news/index.vue'),
  },
  {
    path: '/newsDetail',
    name: 'newsDetail',
    component: () => import('@/views/news/detail.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('@/views/about/index.vue')
  },
  {
    path: '/contact',
    name: 'contact',
    component: () => import('@/views/contact/index.vue')
  },
  {
    path: '/join',
    name: 'join',
    component: () => import('@/views/join/index.vue')
  }
]


const router = createRouter({
  history: createWebHashHistory(),
  routes
})

// router.beforeEach(beforeEach)
// router.afterEach(afterEach)
// router.onError(onError)

export { router }
